home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / System / SafeSwitch / SafeSwitch.readme < prev    next >
Text File  |  2000-05-26  |  5KB  |  127 lines

  1. Short:    Patch for screen switching lock-ups
  2. Uploader: rennex@icon.fi (Renne Nissinen)
  3. Author:   rennex@icon.fi (Renne Nissinen)
  4. Type:     util/misc
  5. Version:  1.0
  6.  
  7.  
  8. Introduction
  9.  
  10.     There's a bug in AmigaOS, or maybe in some common utility,
  11.     that causes the Amiga to hang if you switch screens when
  12.     a window is just about to open. For some reason this
  13.     doesn't happen on all systems but I have suffered from this
  14.     common bug for ages, and I know several other people have
  15.     too.
  16.  
  17.     Then, one day I had enough and decided that I had to at
  18.     least try fixing it. Since disassembling library functions
  19.     would be tedious work, I decided to try patching a couple
  20.     of library functions involved with screens and windows.
  21.     And whaddaya know, after a couple of tries it worked! :)
  22.  
  23.  
  24. SafeSwitch
  25.  
  26.     This small program patches some intuition.library functions
  27.     to wait for their turn, so a screen can't be switched when
  28.     some process is opening a window. I don't know exactly what
  29.     causes the lock-ups in the first place, but since this patch
  30.     seems to work just fine I decided to release it. It is
  31.     freeware and the assembler source code is included. All I
  32.     ask is that you email me whether it works or not :) You'll
  33.     find my address below.
  34.  
  35.     Like I wrote above, some systems don't have this bug. For
  36.     example, I have been told that CGFX patches intuition's
  37.     functions in the same way as SafeSwitch, but I don't
  38.     have it myself so I can't be sure. Test for yourself and
  39.     please, email me whatever you find!
  40.  
  41.  
  42. Usage & Installation
  43.  
  44.     You just copy SafeSwitch to your hard disk and run it. For
  45.     example, copy it to C: and add "run <>nil: C:SafeSwitch" to
  46.     your S:user-startup. If you have SetMan or some other
  47.     SetFunction manager installed, be sure to run SafeSwitch
  48.     after running the manager.
  49.  
  50.     You can quit the program by sending it a ctrl-c, but if
  51.     you don't have a SetFunction manager installed, quitting
  52.     SafeSwitch might crash your system!
  53.  
  54.     SafeSwitch requires AmigaOS 2.04, but it has only been
  55.     tested on AmigaOS 3.0.
  56.  
  57.  
  58. Testing
  59.  
  60.     You can test how SafeSwitch affects your machine with the
  61.     DelayWindow program that is included in this archive. After
  62.     you run it, it waits for one second and then opens a window
  63.     and closes it soon after. So save all your work, *don't* run
  64.     SafeSwitch yet and open 2 or more screens. Run DelayWindow
  65.     and immediately start switching screens as fast as possible,
  66.     with the screen depth button or by pressing LAmiga+M. When
  67.     the window opens after a second, your machine should hang :)
  68.     If it doesn't, try a couple more times. If it still doesn't
  69.     hang, then either you're too slow or you don't need this
  70.     patch :) If it does hang, reboot your Amiga and try again
  71.     with the patch running and see if it hangs any more! And
  72.     don't forget to email me the results :)
  73.  
  74.  
  75. Mystery
  76.  
  77.     The mysterious part about this patch is that when I run it
  78.     once and then quit it, I can't get screen switching to hang
  79.     any more until I reboot... I have no idea why this happens,
  80.     and the best explanation I can think of is that SetMan is
  81.     actually the cause for the hangs and patching some Intuition
  82.     functions removes the thing that SetMan has done wrong. :)
  83.  
  84.  
  85. About the source code
  86.  
  87.     SafeSwitch sets up a semaphore, patches the functions
  88.     ScreenToFront, ScreenToBack, WBenchToFront, WBenchToBack,
  89.     ScreenDepth, OpenWindow and OpenWindowTagList in Intuition
  90.     and starts waiting for messages. The patched functions
  91.     attempt to obtain the semaphore, and if they succeed then
  92.     they'll call the original function and release the semaphore.
  93.     But if they can't obtain it, they send a message to the main
  94.     program and return immediately, and the main program will call
  95.     the function when the semaphore is released. Only the two
  96.     OpenWindow calls won't return until they get their jobs done.
  97.  
  98.     The replacement functions aren't optimized to the max, but
  99.     I actually wrote the code months ago and since it's not
  100.     broken, I decided not to try and fix it :)
  101.  
  102.  
  103. Contact & Updates
  104.  
  105.     Don't hesitate to send all comments, suggestions, bug reports,
  106.     improvements and any other info about SafeSwitch to my email
  107.     address below. Even if you just find the patch useful or useless,
  108.     I'd like to know :) I'd also like to know what OS version and
  109.     CPU you have, and whether or not you are using SetMan.
  110.  
  111.     See the SafeSwitch homepage for possible updates! I will also
  112.     mail everyone who has shown interest in SafeSwitch about all
  113.     future updates.
  114.  
  115.     The current addresses are:
  116.     rennex@icon.fi
  117.     www.icon.fi/~rennex/safeswitch
  118.  
  119.  
  120.     But after June 2000 I should have new, permanent addresses:
  121.     rennex@iki.fi
  122.     www.iki.fi/~rennex/safeswitch
  123.  
  124.  
  125.  
  126.  
  127.